<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>练习vue</title>
    <style>
        #box{
            width: 500px;
            height: 500px;
            position: relative;
            margin-left: 100px;
            margin-top: 100px;
            border: 1px solid #ccc;
        }
        #box2{
            width: 50px;
            height: 50px;
            background-color: tomato;
            position: absolute;
            top: 0;
            left: 0;
        }
    </style>
</head>
<body>

<div id="app">
	<div>{{text}}</div>
</div>



<div id="box">
    <div id="box2"></div>
</div>

<button id="ggg">改变Dom值</button>

<div id="father">
    <div id="child">孩子1</div>
    <div id="child2">孩子2</div>
</div>
<input type="checkbox" name="www" id="bjjj">无法编辑

<label id="lala">我是啦啦啦啊<span>span</span></label>
<audio src="http://music.163.com/song/media/outer/url?id=33894312.mp3" controls="controls"></audio>

<select id="qwe">
    <option value="">请选择</option>
    <option value="cd" id="cd9">阿里</option>
    <option value="ef" id="ef9">百度</option>
    <option value="gh" id="gh9">淘宝</option>
</select>

<div>这是一段文件</div>
<input type="text" name="" id="shiluo">
<button id="shijiao">失去焦点</button>

<script src="./lib/jquery.js"></script>
<script>

var aaa= ["1"];
var bbb = aaa;
bbb.push("2");
console.log(aaa);


// localStorage.setItem("search",shuzu10);
// var shuzu10 = [];
// var shuzu11 = shuzu10;

// shuzu10 = JSON.stringify(shuzu10);

// console.log(shuzu10);
// console.log(shuzu11);

// var ccc = shuzu10.some(function(val,ind){
//     if(val === "b"){
//         // return "lala";
//         return true;
//     }else{
//         console.log(val);
//     }
// });

// console.log(ccc);


// console.log(document.getElementById("lala").innerHTML);
// console.log($("#lala").innerHTML);
// // var Dom = $("#child").parent().children().css("color","skyblue");
// // console.log(Dom);
// var shuzi3 = 105;
// var ceshiceshi  =  100 <= shuzi3 <=120 ?  "yes": "no";
// console.log(ceshiceshi);
// 组醉赤壁           
// 不为谁而作的歌  
// 那些你很冒险的梦  --当前 
// 当你    



// 告白气球
// 算什么男人 
// 龙卷风   --当前
// 红尘

// $("#shijiao").on("click",function(){
//     document.getElementById("shiluo").blur();
// });
// var qqq= ["a"];
// qqq.splice(1,0,"b");
// console.log(qqq);


var shuzu = "abc";
var shuzu2 = shuzu.splice(0,1);
console.log(shuzu2);

console.log(b);
function changeA(res){
    var num = 1;
    if(num ==1){
        console.log("aaaaaaaa");
        num = num +1;
    }else if(num ==1){
        console.log("bbbbbbbbbb");
    }
}

changeA();

var objectnull = {};
var objectnull2 = JSON.stringify(objectnull);

console.log(objectnull);
console.log(objectnull2);

var Dom = true;
$("#ggg").on("click",function(){
    Dom = !Dom;

    
});

console.log($("#bjjj").prop("checked",true));

if(Dom === true){
        console.log("我是DOM1");
    }else{
        console.log("我是mmm");
    }




var shuzu = ["a","b","c"];
var shuzu2 = shuzu;

var duixianga = {age: 18};
var duixiangb = duixianga;
duixiangb.age = 20;

console.log(duixianga);

// shuzu2.sort(function(){
//     return Math.random() - 0.5;
// });

// for(var i=0;i<shuzu2.length;i++){
//     var j = Math.floor(Math.random() * (i-0+1)+0);
//     var t = shuzu2[i];
//     shuzu2[i] = shuzu2[j];
//     shuzu2[j] = t;
// }

shuzu2[0] = "d";

console.log(shuzu);
console.log(shuzu2);


$("#sxsx").on("click",function(){
    document.location.reload();
});


var arryEx = ["刘备","张飞","关羽"];
var arryRan = arryEx.sort(function(){
    return Math.random() - 0.5;
});

function nike(){
    console.log("开始");
    if(true){
        return false;
    }else{
        console.log("失败");
    }
    console.log("看看这句话还有没有");
}

nike();
console.log(arryRan);

var numb = "0.0001";
console.log(numb * 1);
// console.log(numb.toFixed(2));
$(function(){

    $("#box2").on("mousedown",function(event){
        var juli1 = $(this).position().left;

        var ceshi = document.getElementById("box2").style.left;

        console.log("盒子距离左边的矩形"+ juli1);
        console.log(ceshi);
        var juli2 = event.pageX;

        console.log("我鼠标的距离"+ juli2);

        var zhongjian = juli2 - juli1;

        console.log("差距值"+ zhongjian);


    $(document).on("mousemove",function(event){
       
        console.log("我移动的鼠标距离"+ event.pageX);
        var juli3 = event.pageX - zhongjian;

        $("#box2").css("transform","translateX("+juli3+"px)");        
    });

    $(document).on("mouseup",function(){

        $(document).off("mousemove");       
    });


        
    });

   


})


    function parseLyric(lrc) {
    var lyrics = lrc.split("\n");
    var lrcObj = {};
    for(var i=0;i<lyrics.length;i++){
        var lyric = decodeURIComponent(lyrics[i]);
        var timeReg = /\[\d*:\d*((\.|\:)\d*)*\]/g;
        var timeRegExpArr = lyric.match(timeReg);
        if(!timeRegExpArr)continue;
        var clause = lyric.replace(timeReg,'');
        for(var k = 0,h = timeRegExpArr.length;k < h;k++) {
            var t = timeRegExpArr[k];
            var min = Number(String(t.match(/\[\d*/i)).slice(1)),
                sec = Number(String(t.match(/\:\d*/i)).slice(1));
            var time = min * 60 + sec;
            lrcObj[time] = clause;
        }
    }
    return lrcObj;
}

        var lyobj = parseLyric("[00:12.570]难以忘记初次见你"); 
        console.log(lyobj);
     
  
    


</script>
</body>
</html>